import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
  selector: 'app-click',
  templateUrl: './click.component.html',
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class ClickComponent {
  data = [
    {
      title: `This is the title of the long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long target`,
      description: `So strongly and metaphysically did I conceive of my situation then, that while earnestly watching his motions, I seemed distinctly to perceive that my strongly and metaphysically did I conceive of my situation then, that while earnestly watching his motions, I seemed distinctly to perceive that my`,
    },
    {
      title: 'This is the title of the target',
      description: `So strongly and metaphysically did I conceive of my situation then, that while earnestly watching his motions, I seemed distinctly to perceive that my`,
    },
    {
      title: 'This is the title of the target',
    },
  ];

  itemClick(data) {
    console.log('listItem:', data);
  }

  titleClick(e) {
    e.stopPropagation(); // 若不想触发Item上的click, 需阻止冒泡
    console.log('click title');
  }
}
